
#!/usr/bin/env python3
# -*- coding: utf-8 -*


import os
from alibabacloud_tea_openapi import models as open_api_models
from Tea.core import TeaCore
from typing import List

from alibabacloud_alidns20150109.client import Client as DnsClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_alidns20150109 import models as dns_models
from alibabacloud_tea_util.client import Client as UtilClient
from sample import Sample




domain_name = "aotbot.com"
rr = "yps"
record_type = "A"
client = Sample.initialization("LTAI4G8FnNAgwMzuNGaucFcu","IyNJRaR4vQxJ9uov1BVPrdS30dl6oJ")
resp = Sample.describe_domain_records(client, domain_name, rr, record_type)
if UtilClient.is_unset(resp) or UtilClient.is_unset(resp.body.domain_records.record[0]):
    print('错误参数！')
record = resp.body.domain_records.record[0]
print(record)
# 记录ID
record_id = record.record_id
# 记录值
records_value = record.value

print(record_id)
print(records_value)
        # ConsoleClient.log(f'-------------------当前主机公网IP为：{current_host_ip}--------------------')
        # if not UtilClient.equal_string(current_host_ip, records_value):
        #     # 修改解析记录
        #     req = dns_models.UpdateDomainRecordRequest()
        #     # 主机记录
        #     req.rr = rr
        #     # 记录ID
        #     req.record_id = record_id
        #     # 将主机记录值改为当前主机IP
        #     req.value = current_host_ip
        #     # 解析记录类型
        #     req.type = record_type
        #     Sample.update_domain_record(client, req)